import { USER_SET_DATA, PGC_SET_DATA, PGC_DATA, USERAUTHOR_DATA, USERPGC_DATA, USERTHEME_DATA, USERVIDEOS_DATA } from "../action/actionType";

export let my = (state = {
    userData: null,
    pgcData: null,
    userAuthorData: null,
    userPgcData: null,
    userThemeData: null,
    userVideosData: null,
}, action) => {
    let { type } = action;
    let newState = { ...state };
    switch (type) {
        case USER_SET_DATA:
            newState.userData = action.data;
            return newState
            break;
        case PGC_DATA:
            newState.pgcData = action.data;
            return newState
            break;
        case USERAUTHOR_DATA:
            newState.userAuthorData = action.data;
            return newState
            break;
        case USERPGC_DATA:
            newState.userPgcData = action.data;
            return newState
            break;
        case USERTHEME_DATA:
            newState.userThemeData = action.data;
            return newState
            break;
        case USERVIDEOS_DATA:
            newState.userVideosData = action.data;
            return newState
            break;
        default:
            return newState
            break;
    }
}